var root=ui("$");
var helperOpen = require("helper/open");
var starNum = ui("starNum");
var starList = ui("starList");
var linearLayout_shop = ui("linearLayout_shop");
var sendDeliveryType = ui("sendDeliveryType");
var aLayout_sendDeliveryType1 = ui("aLayout_sendDeliveryType1");
var aLayout_sendDeliveryType2 = ui("aLayout_sendDeliveryType2");
var label_sendDeliveryType1 = ui("label_sendDeliveryType1");
var label_sendDeliveryType2 = ui("label_sendDeliveryType2");
root.setMapping({
	"img.source":"fullLogo",
	"name.text":"name",
	"sales.text":"remarks1",
	"resume.text":"remarks2",
	"sendDeliveryType.tag":"sendDeliveryTypeStr2",
	"starNum.text":"resume",
	"linearLayout_shop.tag":"id",
	"do_Label_distance.text" : "cnDistance"
});

root.on("dataRefreshed", function(){
//	var num = starList.tag;
//	var starArr = [];
//	for(var i = 0;i<num;i++){
//		starArr.push({"starImg":"source://image/find/star_on.png"});
//	}
//	if(5-num>0){
//		for(var j,length=5-num;j<length;j++){
//		   starArr.push({"starImg":"source://image/find/star.png"});
//		}   
//	}
//	starList.items = starArr;
	var sendDeliveryTypeStr = sendDeliveryType.tag;
	var array = sendDeliveryTypeStr.split("，");
	if (array.length == 1) {
		label_sendDeliveryType1.text=array[0];
		aLayout_sendDeliveryType2.visible=false;
		label_sendDeliveryType2.visible=false;
	} else {
		label_sendDeliveryType1.text=array[0];
		label_sendDeliveryType2.text=array[1];
		aLayout_sendDeliveryType2.visible=true;
		label_sendDeliveryType2.visible=true;
	}
});

linearLayout_shop.on("touch", "", 300, function(data, e) {
	helperOpen.open("source://view/qshop/detail/main.ui",{shopId:linearLayout_shop.tag});
});